<%--
    Document   : turnoverfood
    Created on : Dec 5, 2011, 5:31:47 PM
    Author     : Venus
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="java.util.*, java.text.NumberFormat, Beans.ThamSoHT,Models.ThamSoHT_Model,  Models.PhieuDatMA_Model, Models.TienTe_Model, Models.Ban_Model "%>
<!--
Danh sách các tham số hệ thống ở trang này :
order      areainfo     areamsg     status      arealang
newarea    areaname     save        action      arealist
enable     disable      search
-->
<%
            int langid = (Integer) session.getAttribute("langid"); // ngôn ngữ hiện tại
            String dsts = " 'quantity', 'enddate', 'datestart', 'bill', 'timehistory', 'table', 'area', 'order', 'turnover', 'turnoverarea' ";
            ThamSoHT[] mdsts = ThamSoHT_Model.DSThamSo(dsts, langid); // mảng chứa các tham số của trang này.

            String area = mdsts[0].getTenTS();
            String bill = mdsts[1].getTenTS();
            String datestart = mdsts[2].getTenTS();
            String enddate = mdsts[3].getTenTS();
            String order = mdsts[4].getTenTS();
            String quantity = mdsts[5].getTenTS();
            String table = mdsts[6].getTenTS();
            String timehistory = mdsts[7].getTenTS();
            String turnover = mdsts[8].getTenTS();
            String turnoverarea = mdsts[9].getTenTS();

            Vector v = (Vector) request.getAttribute("Report");
            String soluong = (String) request.getAttribute("soluong");
            String ngaybd = (String) request.getAttribute("ngaybd");
            String ngaykt = (String) request.getAttribute("ngaykt");
            String makhuvuc = (String) request.getAttribute("makhuvuc");
            String tenban = (String) request.getAttribute("tenban");
            String doanhthu = (String) request.getAttribute("doanhthu");
            NumberFormat nf = NumberFormat.getNumberInstance(Locale.FRENCH);
%>
<html>
    <head></head>
    <body>
        <h2 style=" color: red; margin-left: 120px; margin-top: 40px; text-transform: uppercase;"><%=turnoverarea%></h2>
        <div class="content" style=" margin-left: 120px;">
            <table style=" margin-bottom: 20px;">
                <tr>
                    <td style=" width: 120px; color: #0a74a2;"><%=datestart%></td>
                    <td style=" width: 220px; color: #43a5cf;"><%=ngaybd%></td>
                    <td style=" width: 120px; color: #0a74a2;"><%=enddate%></td>
                    <td style=" width: 220px; color: #43a5cf;"><%=ngaykt%></td>
                </tr>
                <tr>
                    <td style=" color: #0a74a2;"><%=area%></td>
                    <td style="  color: #43a5cf;">
                    <%  if(!makhuvuc.equals("all")){%>
                    <%=Ban_Model.LayTenKV(Integer.parseInt(makhuvuc), langid) %>
                    <%  }%>
                    </td>
                    <td style="  color: #0a74a2;"><%=table%></td>
                    <td style="  color: #43a5cf;"><%=tenban%></td>
                </tr>
                <tr>
                    <td style="  color: #0a74a2;"><%=quantity%></td>
                    <td style=" color: #43a5cf;"><%=soluong%></td>
                    <td style="color: #0a74a2;"><%=turnover%></td>
                    <td style="color: #43a5cf;"><div style=" float: left; width: 80px; text-align: left; margin-right: 15px;"><%=nf.format(Double.parseDouble(doanhthu))%></div><%=TienTe_Model.LayKyHieuTT(langid) %></td>
                </tr>
            </table>
            <table>
                    <tr>
                        <td style=" width: 70px; color: #0a74a2; font-weight: bold; padding-bottom: 5px;"><%=order%></td>
                        <td style=" width: 200px; color: #0a74a2; font-weight: bold; padding-bottom: 5px;"><%=area%></td>
                        <td style=" width: 100px; color: #0a74a2; font-weight: bold; padding-bottom: 5px;"><%=table%></td>
                        <td style=" width: 200px; color: #0a74a2; font-weight: bold; padding-bottom: 5px;"><%=timehistory%></td>
                        <td style=" width: 100px; color: #0a74a2; font-weight: bold; padding-bottom: 5px;"><%=bill%></td>
                        <td style=" width: 150px; color: #0a74a2; font-weight: bold; padding-bottom: 5px;"><%=turnover%></td>
                    </tr>
                    <%
                        for (int i = 0; i < v.size(); i++) {
                            Beans.HoaDon hd = (Beans.HoaDon) v.elementAt(i);
                    %>
                    <tr>
                        <td><%=i + 1%></td>
                        <td><%=PhieuDatMA_Model.LayTenKV(hd.getMaBan(), langid)%></td>
                        <td><%=PhieuDatMA_Model.LayTenBan(hd.getMaBan())%></td>
                        <td><%=hd.getGioRa()%></td>
                        <td><%=hd.getSoHD()%></td>
                        <td><div style=" float: left; width: 70px;"><%=nf.format(hd.getThanhTien())%></div><%=TienTe_Model.LayKyHieuTT(langid) %></td>
                    </tr>
                    <%  }%>
            </table>
        </div>
    </body>
</html>